'use client';

import { Button, Result } from "antd";
import Link from "next/link";
import { useSearchParams } from "next/navigation";

export default function JoinSuccessPage() {
  const searchParams = useSearchParams();
  const courseId = searchParams.get('courseId');
  const courseName = searchParams.get('name');

  return (
    <div className="min-h-screen flex items-center justify-center">
      <Result
        status="success"
        title="成功加入课程"
        subTitle={`您已成功加入课程：${courseName || '未知课程'}`}
        extra={[
          <Link href={`/courses/${courseId}`} key="view">
            <Button type="primary">查看课程</Button>
          </Link>,
          <Link href="/my-courses" key="courses">
            <Button>我的课程</Button>
          </Link>,
        ]}
      />
    </div>
  );
} 